<template>
    <div>
        <p><input type="text" v-model="title" placeholder="输入车牌号">
            <button @click="getRecord">搜索</button>
        </p>
        <table border="1" align="center" width="600px">
            <tr>
                <th>名称</th>
                <th>车牌号</th>
                <th>进入时间</th>
                <th>离开时间</th>
                <th>停留时间</th>
                <th>收费标准</th>
                <th>收取费用</th>
            </tr>
            <tr v-for="record in recordList">
                <th>{{record.user.name}}</th>
                <th>{{record.user.title}}</th>
                <th>{{record.start}}</th>
                <th>{{record.end}}</th>
                <th>{{record.time}}</th>
                <th>{{record.price}}</th>
                <th>{{record.money}}</th>
            </tr>
        </table>
        <router-link to="/login_park">小区门口</router-link>
    </div>
</template>

<script>
    export default {
        name: "record_park",
        data() {
            return {
                recordList: [],
                title: '',
            }
        },
        created() {
            this.$axios({
                url: 'park/record/',
            }).then(resp => {
                this.recordList = resp.data
            })
        },
        methods: {
            getRecord() {
                this.$axios({
                    url: 'park/record/',
                    params: {
                        title: this.title
                    }
                }).then(resp => {
                    this.recordList = resp.data
                })
            }
        },
        computed: {},
        filters: {},
        watch: {},
    }
</script>

<style scoped>

</style>
